//case instance is called "acase" since "case" is a reserved word

package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.CascadeType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.OneToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Embedded;

/**
 *
 * @author Chenhui
 */
@Entity
public class ClientEntity implements Serializable {
    
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private String id;
    private String NRIC;
    private String name;
    private int age;
    private String incomeStatus;
    private String gender;
    private String contactNumber;
    private String email;
    private Date dob;
    private String hobby;
    private String preference;
    private String healthStatus;
    private int loyaltyPoints;
    private String maritalStatus;
    private String nationality;
    private String religion;
    private String race;
    private float netWorth;
    
    @Embedded
    private OccupationEntity occupation;
    
    @Embedded
    @OneToMany(cascade={CascadeType.PERSIST})
    private Collection<AddressEntity> address = new ArrayList<AddressEntity>();
    
    @OneToMany(cascade={CascadeType.PERSIST})
    private Collection<FamilyEntity> familiy = new ArrayList<FamilyEntity>();
    
    @OneToMany(cascade={CascadeType.PERSIST},mappedBy="client")
    private Collection<PortfolioEntity> portfolio=new ArrayList<PortfolioEntity>();
    
    @OneToOne(cascade={CascadeType.PERSIST})
    private CreditReportEntity creditReport;
    
    @OneToOne(cascade={CascadeType.PERSIST})
    private PolicyStatementEntity policyStatement;
    
    @OneToMany(cascade={CascadeType.PERSIST},mappedBy="client")
    private Collection<InsuranceEntity> insurance=new ArrayList<InsuranceEntity>();
    
    @OneToOne(cascade={CascadeType.PERSIST})
    private ClientCaseEntity acase;
    
    
    @ManyToOne(cascade={CascadeType.PERSIST})
    private SystemUserEntity RM;
    
    @OneToOne(cascade={CascadeType.PERSIST})
    private EmployeeEntity account;
    
    @OneToMany(cascade={CascadeType.PERSIST})
    private Collection<AssetEntity> asset=new ArrayList<AssetEntity>();
    
    public ClientEntity(){}
    
    public void create(String name, int age,  String incomeStatus, String gender,
            String contactNumber, String email, Date dob, String NRIC, int loyaltyPoints, String maritalStatus,
            String nationality, String religion, String race) {//not include: hobby, preference, health, networth
            this.setName(name);
            this.setAge(age);
            this.setIncomeStatus(incomeStatus);
            this.setGender(gender);
            this.setNationality(nationality);
            this.setEmail(email);
            this.setDob(dob);
            this.setNRIC(NRIC);
            this.setLoyaltyPoints(loyaltyPoints);
            this.setMaritalStatus(maritalStatus);
            this.setContactNumber(contactNumber);
            this.setReligion(religion);
            this.setRace(race);
    }

    public String getNRIC() {
        return NRIC;
    }

    public void setNRIC(String NRIC) {
        this.NRIC = NRIC;
    }

    public SystemUserEntity getRM() {
        return RM;
    }

    public void setRM(SystemUserEntity RM) {
        this.RM = RM;
    }

    public ClientCaseEntity getAcase() {
        return acase;
    }

    public void setAcase(ClientCaseEntity acase) {
        this.acase = acase;
    }

    public EmployeeEntity getAccount() {
        return account;
    }

    public void setAccount(EmployeeEntity account) {
        this.account = account;
    }

    public Collection<AddressEntity> getAddress() {
        return address;
    }

    public void setAddress(Collection<AddressEntity> address) {
        this.address = address;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Collection<AssetEntity> getAsset() {
        return asset;
    }

    public void setAsset(Collection<AssetEntity> asset) {
        this.asset = asset;
    }

    public String getContactNumber() {
        return contactNumber;
    }

    public void setContactNumber(String contactNumber) {
        this.contactNumber = contactNumber;
    }

    public CreditReportEntity getCreditReport() {
        return creditReport;
    }

    public void setCreditReport(CreditReportEntity creditReport) {
        this.creditReport = creditReport;
    }

    public Date getDob() {
        return dob;
    }

    public void setDob(Date dob) {
        this.dob = dob;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Collection<FamilyEntity> getFamiliy() {
        return familiy;
    }

    public void setFamiliy(Collection<FamilyEntity> familiy) {
        this.familiy = familiy;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getHealthStatus() {
        return healthStatus;
    }

    public void setHealthStatus(String healthStatus) {
        this.healthStatus = healthStatus;
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getIncomeStatus() {
        return incomeStatus;
    }

    public void setIncomeStatus(String incomeStatus) {
        this.incomeStatus = incomeStatus;
    }

    public Collection<InsuranceEntity> getInsurance() {
        return insurance;
    }

    public void setInsurance(Collection<InsuranceEntity> insurance) {
        this.insurance = insurance;
    }

    public int getLoyaltyPoints() {
        return loyaltyPoints;
    }

    public void setLoyaltyPoints(int loyaltyPoints) {
        this.loyaltyPoints = loyaltyPoints;
    }

    public String getMaritalStatus() {
        return maritalStatus;
    }

    public void setMaritalStatus(String maritalStatus) {
        this.maritalStatus = maritalStatus;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNationality() {
        return nationality;
    }

    public void setNationality(String nationality) {
        this.nationality = nationality;
    }

    public float getNetWorth() {
        return netWorth;
    }

    public void setNetWorth(float netWorth) {
        this.netWorth = netWorth;
    }

 
    public PolicyStatementEntity getPolicyStatement() {
        return policyStatement;
    }

    public void setPolicyStatement(PolicyStatementEntity policyStatement) {
        this.policyStatement = policyStatement;
    }

    public Collection<PortfolioEntity> getPortfolio() {
        return portfolio;
    }

    public void setPortfolio(Collection<PortfolioEntity> portfolio) {
        this.portfolio = portfolio;
    }

    public String getPreference() {
        return preference;
    }

    public void setPreference(String preference) {
        this.preference = preference;
    }

    public String getRace() {
        return race;
    }

    public void setRace(String race) {
        this.race = race;
    }

    public String getReligion() {
        return religion;
    }

    public void setReligion(String religion) {
        this.religion = religion;
    }

    public OccupationEntity getOccupation() {
        return occupation;
    }

    public void setOccupation(OccupationEntity occupation) {
        this.occupation = occupation;
    }
            
    
    
    
    
    
    
}
